<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class User_log_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    function add($data) {
        $this->db->insert('zjy_user_log', $data);
        return $this->db->affected_rows();
    }

    function update($data, $where) {
        if (!empty($where)) {
            $this->db->where($where);
        }
        $this->db->update('zjy_user_log', $data);
        return $this->db->affected_rows();
    }

    function get_one($where = array(), $select = '*') {
        $this->db->select($select);
        if (!empty($where)) {
            $this->db->where($where);
        }
        $this->db->limit(1);
        $query = $this->db->get('zjy_user_log');
        return $query->row_array();
    }

    function get_list($where = array(), $select = '*') {
        $this->db->select($select);
        if (!empty($where)) {
            $this->db->where($where);
        }
        $query = $this->db->get('zjy_user_log');
        return $query->result_array();
    }

}
